
</head>
<script type="text/javascript">
$(document).ready(function(){
 $.formValidator.initConfig({autotip:true,formid:"myform",onerror:function(msg){}});
 
 $("#classname").formValidator({onshow:"请输入栏目名称",onfocus:"请输入栏目名称"}).inputValidator({min:1,onerror:"请输入栏目名称"})

 
})

$(function(){
		
	$("select[name='modelid']").change(function(){
		
		select_tpl($(this).val(),'','');
		
	})
	select_tpl('<{$data['modelid']}>','<{$Think.get.id}>','<{$Think.get.id}>');
}) 

function select_tpl(modelid,id,show){

	$.get('<{:U('select_tpl_ajax')}>','modelid='+modelid+'&id='+id+'&show='+show,function(data){

			arr=eval("("+data+")");
			$("#list_template").html(arr['list']);
			$("#show_template").html(arr['show']);
		
	});
}

$(function(){
	
	$("select[name='list_template']").live('change',function(){

		if($(this).val()==''){
			select_tpl('<{$data['modelid']}>','<{$data['id']}>',1); //显示全部模板
		}
		
	})
})




</script>
<include file="Index/header" /><body>

<!--add-tab-->
<div class="add-tab" style="border:0;">
	<div class="at_tab">
		<a href="<{:U('index')}>"><i>管理栏目</i></a> | 
		<if condition="ACTION_NAME eq 'add'">
			<a href="<{:U('add')}>" class="cur"><i>添加栏目</i></a>
			<else/>
			
				<a href="javascript:;" class="cur"><i>编辑栏目</i></a>
		</if>

		

	</div>
	<a href="javascript:location.reload();" style="float:right;" class="f5">刷新</a>
	<a href="javascript:window.history.go(-1);" style="float:right; margin-right:5px;" class="back">&lt;返回</a>
	<div class="clearall"></div>
</div>
<!--add-tab-->
<!--table-list-->
<div class="table-edit ">
	<form method="post" id="myform">

	<div class="table-edit_tab">
		<ul>
			<li data-id="te_tab_1" class="cur"><a href="#">基本选项</a></li>
		
			<li data-id="te_tab_3"><a href="#">SEO 设置</a></li>
			<li data-id="te_tab_4"><a href="#">模板设置</a></li>
		</ul>
		<div class="clearall"></div>
	</div>
	<div class="table-edit_form" style="padding-bottom:30px;">
		<div id="te_tab_1" class="te_tab_c">
			<table cellpadding="0" cellspacing="0" border="0" width="100%" class="table-edit_tb">
			<tbody>		
			<tr>
				<th width="200">请选择模型：</th>
				<td>
					<{$data['model']}>
				</td>
			</tr>
			<tr>
				<th>所属栏目：</th>
				<td>
					<select name="pid" id="pid">
					<option value="0">作为一级栏目</option>
					<{$data['category_list']}>
					</select>
				</td>
			</tr>
			<tr>
				<th>栏目名称：</th>
				<td><input type="text" class="sys_text" name="classname" id="classname" value="<{$data['classname']|escapeshow=###}>" /></td>
			</tr>
			<tr>
				<th>英文目录：</th>
				<td><input type="text" class="sys_text" name="dirname" id="dirname" value="<{$data['dirname']|escapeshow=###}>" /></td>
			</tr>
			<tr>
				<th>属性：</th>
				<td>
                	<?php $classFlagArr=C("contentclassflag");?>
                	<foreach name="classFlagArr" item="v">
                	<label><input type="checkbox" name="flag[]" <if condition=' in_array($key,explode(",",$data["flag"])) '> checked="checked"</if> value="<{$key}>" /> <{$v}>[<{$key}>]</label>&nbsp;
                    </foreach>
				</td>
			</tr>
			<tr>
				<th>链接地址：</th>
				<td><input type="text" class="sys_text" name="url" id="url" value="<{$data['url']|escapeshow=###}>" /></td>
			</tr>
			<tr>
				<th>栏目图片：</th>
				<td>
				<a style="padding:0;margin:0; float:left; margin-right:10px;" target="_blank" href="<{$data['picurl']}>" id="picurl_link"><img id="picurl_img" src="<{$data['picurl']}>" style="width:auto;height:auto; max-width:100px; max-height:80px;" /></a>
				<span style="float:left;"><input type="text" class="sys_text sys_text350"  style="margin-bottom:5px;" name="picurl" id="picurl" value="<{$data['picurl']}>"  /><br><input type="button" class="sys_btn" value="上传图片" onClick="getuploadify('uploadify','缩略图上传','image','image',1,<{:C(cfg_max_file_size)}>,'picurl')" /></span>
			<script>
			$(function(){
				$("#picurl").change(function(){
					var thisval=$(this).val();
					$("#picurl_link").attr("href",thisval);
					$("#picurl_img").attr("src",thisval);
				});
				
			});
			</script>
				</td>
			</tr>
			<tr>
				<th>排序：</th>
				<td><input type="text" class="sys_text" name="orderid" id="orderid" value="<{$data['orderid']|intval=###}>" /></td>
			</tr>		
			<tr>
				<th>是否在导航显示：</th>
				<td>
					<label><input type="checkbox"  value="1" name="navshow" <if condition="$data['navshow']  eq '1' "> checked="checked" </if> /> 显示 </label> 
				</td>
			</tr>			
			<tr>
				<th>是否显示：</th>
				<td>
					<label><input type="checkbox"   value="1" name="checkinfo"  <if condition="$data['checkinfo']  eq '1' "> checked="checked" </if> /> 不显示 </label> 
				</td>
			</tr>
			</tbody>
		</table>
		</div>
		<div id="te_tab_2" class="te_tab_c" style="display:none;">
			<table cellpadding="0" cellspacing="0" border="0" width="100%" class="table-edit_tb">
			<tbody>
			<tr>
				<th width="200">栏目生成Html：</th>
				<td>
					<input type="text" value="" name="" class="sys_text">
				</td>
			</tr>
			<tr>
				<th>内容页生成Html：</th>
				<td>
					<select>
					<option value="" selected="">请选择模型</option>
					<option value="1">文章模型</option>
					<option value="2">下载模型</option>
					<option value="3">图片模型</option>
					<option value="11">产品模型</option></select>
				</td>
			</tr>
			
			</tbody>
		</table>
		</div>
		
		<div id="te_tab_3" class="te_tab_c" style="display:none;">
			<table cellpadding="0" cellspacing="0" border="0" width="100%" class="table-edit_tb">
			<tbody>
			<tr>
				<th  width="200">
				<strong>META Title（栏目标题）</strong>
					<br>
				针对搜索引擎设置的标题
				</th>
				<td>
					<input type="text" name="seotitle" class="sys_text sys_text350" value="<{$data['seotitle']|escapeshow=###}>">
				</td>
			</tr>
			<tr>
				<th>
					<strong>META Keywords（栏目关键词）</strong>
					<br>
					关键字中间用半角逗号隔开
				</th>
				<td>
				<textarea name="keywords" class="sys_textarea sys_textarea350"><{$data['keywords']|escapeshow=###}></textarea>
				</td>
			</tr>			
			<tr>
				<th>
					<strong>META Description（栏目描述）</strong>
						<br>
					针对搜索引擎设置的网页描述
				</th>
				<td>
				<textarea name="description" class="sys_textarea sys_textarea350"><{$data['description']|escapeshow=###}></textarea>
				</td>
			</tr>
			
			</tbody>
		</table>
		</div>		
		
		<div id="te_tab_4" class="te_tab_c" style="display:none;">
			<table cellpadding="0" cellspacing="0" border="0" width="100%" class="table-edit_tb">
			<tbody>
	
			<tr>
				<th width="200">
					栏目列表页模板：
				</th>
				<td id="list_template">
				
					
				</td>
			</tr>			
			<tr>
				<th>
					内容页模板：
				</th>
				<td id="show_template">
					
				</td>
			</tr>
			
			</tbody>
		</table>
		</div>
		
	</div>
	<div class="tools-edit">
		<table cellpadding="0" cellspacing="0" border="0" width="100%" class="tools-list_tb">
			<tr>
				<th width="200">&nbsp;</th>
				<td>
					<input type="submit" class="sys_blue_btn" value="提交" name="send" /> 
					<input type="hidden" value="<{$data['id']}>" name="id">
				</td>
			</tr>
		</table>
	</div>
	</form>
</div>
<!--/table-list-->
</body>
</html>
